<!-- BEGIN DYNAMIC BLOCK: imdb_search -->
		<form name="imdb_search" method="post" action="?page=admin&sub=mymovies&f=add_movie_lookup">
        	<label title="{LANG_MOVIE_TITLE}">{LANG_MOVIE_TITLE}: <input type="text" size="40" name="movie_title" /></label>
            <input type="submit" name="Submit" value="{LANG_SEARCH_IMDB}" />
        </form>
<!-- END DYNAMIC BLOCK: imdb_search -->

<!-- BEGIN DYNAMIC BLOCK: imdb_results -->
		<table>
        	<tr>
            	<th>{LANG_MOVIE_TITLE}</th><th>{LANG_ADD_THIS_MOVIE}</th><th>{LANG_VIEW_ON_IMDB}</th>
            </tr>
            <!-- BEGIN DYNAMIC BLOCK: imdb_results_row -->
            <tr class="{ALTERNATE_COLORS_CLASS}">
            	<td>{RES_TITLE}</td>
                <td><a href="?page=admin&sub=mymovies&f=add_movie_lookup&add={RES_ID}">{LANG_ADD_THIS_MOVIE}</a></td>
                <td><a href="http://www.imdb.com/title/{RES_ID}/" target="_blank">{LANG_VIEW_ON_IMDB}</a></td>
            </tr>
            <!-- END DYNAMIC BLOCK: imdb_results_row -->
        </table>
<!-- END DYNAMIC BLOCK: imdb_results -->

<!-- BEGIN DYNAMIC BLOCK: add_movie_form -->
		<script language="javascript">
			<!--
			function addField(td)
			{			
				var table = document.getElementById('add_movie_table');
				var rows  = table.rows;
				for( var i = 0, n = rows.length; i < n; ++i)
				{
					rows[i].id = "row_" + i;
				}
				//get name of input field
				var browser = navigator.appName;
				var input_name = '';
				if(browser == 'Microsoft Internet Explorer')
				{
					input_name = td.parentNode.nextSibling.childNodes[0].name;
				}
				else
				{
					input_name = td.parentNode.nextSibling.nextSibling.childNodes[0].attributes[2].nodeValue;
				}

				//get this rows number
				var id = td.parentNode.parentNode.id.substring(4);
				id ++;
							
				try {
					var newRow = table.insertRow(id);
					var newCell = newRow.insertCell(0);
					newCell.innerHTML = '&nbsp;';
					var newCell2 = newRow.insertCell(1);
					if(input_name == 'movie_cast_name[]')
					{
						newCell2.innerHTML = '<input type="text" size="30" name="' + input_name + '" value="" /> {LANG_AS}: <input type="text" size="30" name="movie_cast_as[]" value="" /><a href="javascript:void(0)" onClick="removeField(this)">Remove me</a>';
					}
					else
					{
						newCell2.innerHTML = '<input type="text" size="40" name="' + input_name + '" value="" /><a href="javascript:void(0)" onClick="removeField(this)">Remove me</a>';
					}
				} catch (ex) {
					alert(ex);
				}

			}
			
			function removeField(td)
			{			
				var table = document.getElementById('add_movie_table');
				var rows  = table.rows;
				for( var i = 0, n = rows.length; i < n; ++i)
				{
					rows[i].id = "row_" + i;
				}
				//get this rows number
				var id = td.parentNode.parentNode.id.substring(4);
				//id ++;
							
				try {
					table.deleteRow(id);
				} catch (ex) {
					alert(ex);
				}

			}
			
			function updatePicture()
			{
				var tmp = document.getElementById('poster_image').src = document.forms.add_movie.movie_poster.value;
			}
			-->
		</script>
		<form name="add_movie" method="post" action="?page=admin&sub=mymovies&f={FUNCTION}">
		<table id="add_movie_table">
        	<tr>
            	<td valign="top">{LANG_POSTER}:</td>
                <td><input type="text" size="40" name="movie_poster" value="{RES_POSTER}" onChange="updatePicture()" /><br />{POSTER}</td>
            </tr>
        	<tr>
            	<td>{LANG_TITLE}:</td>
                <td><input type="text" size="40" name="movie_title" value="{RES_TITLE}" /><input type="hidden" name="movie_id" value="{RES_MOVIE_ID}" /></td>
            </tr>
            <tr>
            	<td>{LANG_AKA}:</td>
                <td><input type="text" size="40" name="movie_aka" value="{RES_AKA}" /></td>
            </tr>
            <tr>
            	<td><a href="javascript:void(0)" onclick="addField(this)">ADD</a> {LANG_DIRECTOR}:</td>
                <td><input type="text" size="40" name="movie_director[]" value="{RES_DIRECTOR}" /></td>
            </tr>
            <!-- BEGIN DYNAMIC BLOCK: add_movie_form_director -->
            <tr>
                <td>&nbsp;</td>
                <td><input type="text" size="40" name="movie_director[]" value="{RES_DIRECTOR}" /></td>
            </tr>
            <!-- END DYNAMIC BLOCK: add_movie_form_director -->
            <tr>
            	<td><a href="javascript:void(0)" onclick="addField(this)">ADD</a> {LANG_GENRE}:</td>
                <td><input type="text" size="40" name="movie_genre[]" value="{RES_GENRE}" /></td>
            </tr>
            <!-- BEGIN DYNAMIC BLOCK: add_movie_form_genre -->
            <tr>
                <td>&nbsp;</td>
                <td><input type="text" size="40" name="movie_genre[]" value="{RES_GENRE}" /></td>
            </tr>
            <!-- END DYNAMIC BLOCK: add_movie_form_genre -->
            <tr>
            	<td>{LANG_YEAR}:</td>
                <td><input type="text" size="40" name="movie_year" value="{RES_YEAR}" /></td>
            </tr>
            <tr>
            	<td><a href="javascript:void(0)" onclick="addField(this)">ADD</a> {LANG_CAST}:</td>
                <td><input type="text" size="30" name="movie_cast_name[]" value="{RES_CAST_NAME}" /> {LANG_AS}: <input type="text" size="30" name="movie_cast_as[]" value="{RES_CAST_AS}" /></td>
            </tr>
            <!-- BEGIN DYNAMIC BLOCK: add_movie_form_cast -->
            <tr>
                <td>&nbsp;</td>
                <td><input type="text" size="30" name="movie_cast_name[]" value="{RES_CAST_NAME}" /> {LANG_AS}: <input type="text" size="30" name="movie_cast_as[]" value="{RES_CAST_AS}" /></td>
            </tr>
            <!-- END DYNAMIC BLOCK: add_movie_form_cast -->
            <tr>
            	<td><a href="javascript:void(0)" onclick="addField(this)">ADD</a> {LANG_WRITER}:</td>
                <td><input type="text" size="40" name="movie_writer[]" value="{RES_WRITER}" /></td>
            </tr>
            <!-- BEGIN DYNAMIC BLOCK: add_movie_form_writer -->
            <tr>
                <td>&nbsp;</td>
                <td><input type="text" size="40" name="movie_writer[]" value="{RES_WRITER}" /></td>
            </tr>
            <!-- END DYNAMIC BLOCK: add_movie_form_writer -->
            <tr>
            	<td>{LANG_TAGLINE}:</td>
                <td><input type="text" size="40" name="movie_tagline" value="{RES_TAGLINE}" /></td>
            </tr>
            <tr>
            	<td valign="top">{LANG_PLOT}:</td>
                <td><textarea name="movie_plot" cols="40" rows="10">{RES_PLOT}</textarea></td>
            </tr>
            <tr>
            	<td>{LANG_COUNTRY}:</td>
                <td><input type="text" size="40" name="movie_country" value="{RES_COUNTRY}" /></td>
            </tr>
            <tr>
            	<td><a href="javascript:void(0)" onclick="addField(this)">ADD</a> {LANG_LANGUAGE}:</td>
                <td><input type="text" size="40" name="movie_language[]" value="{RES_LANGUAGE}" /></td>
            </tr>
            <!-- BEGIN DYNAMIC BLOCK: add_movie_form_language -->
            <tr>
                <td>&nbsp;</td>
                <td><input type="text" size="40" name="movie_language[]" value="{RES_LANGUAGE}" /></td>
            </tr>
            <!-- END DYNAMIC BLOCK: add_movie_form_language -->
            <tr>
            	<td>{LANG_COLOR}:</td>
                <td><input type="text" size="40" name="movie_color" value="{RES_COLOR}" /></td>
            </tr>
            <tr>
            	<td>{LANG_IMDB_RATING}:</td>
                <td><input type="text" size="40" name="movie_imdb_rating" value="{RES_IMDB_RATING}" /></td>
            </tr>
            <tr>
            	<td>{LANG_PERSONAL_RATING}:</td>
                <td><input type="text" size="40" name="movie_personal_rating" value="{RES_PERSONAL_RATING}" /></td>
            </tr>
            <tr>
            	<td><a href="javascript:void(0)" onclick="addField(this)">ADD</a> {LANG_AWARDS}:</td>
                <td><input type="text" size="40" name="movie_awards[]" value="{RES_AWARDS}" /></td>
            </tr>
            <!-- BEGIN DYNAMIC BLOCK: add_movie_form_awards -->
            <tr>
                <td>&nbsp;</td>
                <td><input type="text" size="40" name="movie_awards[]" value="{RES_AWARDS}" /></td>
            </tr>
            <!-- END DYNAMIC BLOCK: add_movie_form_awards -->
            <tr>
            	<td>{LANG_IMDB_ID}:</td>
                <td><input type="text" size="40" name="movie_imdb_id" value="{RES_IMDB_ID}" /></td>
            </tr>
            <tr>
            	<td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
            	<td><input type="submit" name="Submit" value="{SUBMIT}" /></td>
                <td>&nbsp;</td>
            </tr>
        </table>
        </form>
<!-- END DYNAMIC BLOCK: add_movie_form -->

<!-- BEGIN DYNAMIC BLOCK: movie_list -->
<table>
	<!-- BEGIN DYNAMIC BLOCK: movie_list_row -->
	<tr class="{ALTERNATE_COLORS_CLASS}">
        <td><a href="?page=admin&sub=mymovies&f=edit&m={MOVIE_ID}"><img alt="{LANG_EDIT}" border="none" src="themes/default/images/edit.gif" /></a>
        	<a href="?page=admin&sub=mymovies&f=remove&m={MOVIE_ID}" onClick="return confirm('{LANG_SURE_REMOVE} - {MOVIE_TITLE}?');"><img alt="{LANG_REMOVE}" border="none" src="themes/default/images/remove.gif" /></a>
        </td>
        <td>{MOVIE_TITLE}</td>
    </tr>
    <!-- END DYNAMIC BLOCK: movie_list_row -->
    <tr>
    	<td colspan="2" align="right">{PAGING}</td>
    </tr>
</table>
<!-- END DYNAMIC BLOCK: movie_list -->